package com.vang.chue.capm.jsf.backingbean;

import com.vang.chue.capm.service.RegistrationService;
import org.springframework.beans.factory.annotation.Autowired;

import javax.faces.component.UIInput;
import javax.faces.event.ActionEvent;

/**
 * Created by IntelliJ IDEA.
 * User: chuevang
 * Date: 11/6/11
 * Time: 12:26 PM
 * To change this template use File | Settings | File Templates.
 */
public class RegistrationBean {

    @Autowired
    RegistrationService registrationService;

    private UIInput firstNameInput;
    private UIInput lastNameInput;
    private UIInput sexInput;

    private String firstName;
    private String lastName;
    private String sex;


    public void registerActionListener(ActionEvent ae)
    {
        getRegistrationService().registerPerson(firstName, lastName, sex);
        
    }

    public String registerAction()
    {
        return "";
    }

    public UIInput getFirstNameInput() {
        return firstNameInput;
    }

    public void setFirstNameInput(UIInput firstNameInput) {
        this.firstNameInput = firstNameInput;
    }

    public UIInput getLastNameInput() {
        return lastNameInput;
    }

    public void setLastNameInput(UIInput lastNameInput) {
        this.lastNameInput = lastNameInput;
    }

    public UIInput getSexInput() {
        return sexInput;
    }

    public void setSexInput(UIInput sexInput) {
        this.sexInput = sexInput;
    }

    public String getFirstName() {
        return firstName;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    public String getLastName() {
        return lastName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public RegistrationService getRegistrationService() {
        return registrationService;
    }

    public void setRegistrationService(RegistrationService registrationService) {
        this.registrationService = registrationService;
    }
}
